package com.codewsq;

/**
 * 设计模式之：模板方法模式
 * 大部分功能确定，一部分功能不确定，抽象类的一个经典用法
 */
public class BankMain {
    public static void main(String[] args) {
        DrawMoney drawMoney = new DrawMoney();
        drawMoney.process();
        System.out.println("-------------------------------------------");
        ManagerMoney managerMoney = new ManagerMoney();
        managerMoney.process();

    }
}


abstract class Bank {

    public void queue() {
        System.out.println("正在排队");
    }


    public abstract void business();


    public void complete() {
        System.out.println("操作完成");
    }

    public void process(){
        this.queue();
        this.business();
        this.complete();
    }
}


class DrawMoney extends Bank{


    @Override
    public void business() {
        System.out.println("我是来取款的！");
    }
}

class ManagerMoney extends Bank{

    @Override
    public void business() {
        System.out.println("我是来理财的!");
    }
}